
ALTER PROCEDURE [dbo].[InitializeLayout] 
	@Loop_Limit int = 40
AS
BEGIN
	DECLARE @intFlag INT
	DECLARE @row INT
	DECLARE @col INT
	SET @intFlag = 0
	SET @row = 0
	SET @col = 0
	WHILE (@intFlag < @Loop_Limit)
		BEGIN
			INSERT INTO [dbo].[Layout] ([Land_ID],[Row],[Column]) VALUES((SELECT Land_ID FROM [dbo].[fn_GetNthRow] (@intFlag+1)),@row,@col)
			SET @intFlag = @intFlag + 1
			SET @row = @row + 1
			if @row%10 = 0
			Begin
				SET @col = @col + 1
			END
				
	
		END
END


-- [InitializeLayout] @Loop_Limit = 40
